package cn.dyw.cloudmusic.dao;

import cn.dyw.cloudmusic.entity.MusicLyric;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface MusicLyricMapper {
    /**
     */
    @Delete({
        "delete from music_lyric",
        "where lyric_id = #{lyricId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer lyricId);

    /**
     */
    @Insert({
        "insert into music_lyric (lyric_id, sgc, ",
        "sfy, qfy, lyric_user_id, ",
        "code)",
        "values (#{lyricId,jdbcType=INTEGER}, #{sgc,jdbcType=BIT}, ",
        "#{sfy,jdbcType=BIT}, #{qfy,jdbcType=BIT}, #{lyricUserId,jdbcType=INTEGER}, ",
        "#{code,jdbcType=INTEGER})"
    })
    int insert(MusicLyric record);

    /**
     */
    int insertSelective(MusicLyric record);

    /**
     */
    @Select({
        "select",
        "lyric_id, sgc, sfy, qfy, lyric_user_id, code",
        "from music_lyric",
        "where lyric_id = #{lyricId,jdbcType=INTEGER}"
    })
    @ResultMap("cn.dyw.cloudmusic.dao.MusicLyricMapper.BaseResultMap")
    MusicLyric selectByPrimaryKey(Integer lyricId);

    /**
     */
    int updateByPrimaryKeySelective(MusicLyric record);

    /**
     */
    @Update({
        "update music_lyric",
        "set sgc = #{sgc,jdbcType=BIT},",
          "sfy = #{sfy,jdbcType=BIT},",
          "qfy = #{qfy,jdbcType=BIT},",
          "lyric_user_id = #{lyricUserId,jdbcType=INTEGER},",
          "code = #{code,jdbcType=INTEGER}",
        "where lyric_id = #{lyricId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(MusicLyric record);
}